package simple;

/**
 * @author 421527548@qq.com
 * @version V1.0
 * @title
 * @description
 * @date 2022-11-14 12:44
 */
 public class FoodFactory extends AbstractFactory{

    @Override
    public Weapon getWeapon(String type) {
        return null;
    }

    @Override
    public Food getFood(String foodType) {
        if ("APPLE".equals(foodType)){
            return new Apple();
        }else if ("BREAD".equals(foodType)){
            return new Bread();
        }else {
            throw new RuntimeException("不能生产此类产品");
        }
    }
}
